home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / AOCE Sample Code / PowerTalk Access Modules / Sample PMSAM / PMSAM Framework / Common / CDSSpec.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-28  |  2.4 KB  |  107 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        CDSSpec.h
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Written by:    Tim Harnett
  7.  
  8.     Copyright:    © 1994 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <4>    10/14/94    TMH        added CDSSpec constructor
  13.          <3>    10/13/94    TMH        added methods to access directory info
  14.          <2>     9/27/94    TMH        added CUnpackedDSSpec assignment operator
  15.          <1>     9/20/94    TMH        Abandon RoadsideRest embrace Mercury
  16.          <2>      9/9/94    TMH        added constructor to CUnpackedDSSpec
  17.                  6/10/94    TMH        xxx put comment here xxx
  18.  
  19.     To Do:
  20. */
  21.  
  22. #ifndef __CDSSpec__
  23. #define __CDSSpec__
  24.  
  25. #ifndef __OCE__
  26. #include "OCE.h"
  27. #endif
  28.  
  29. #ifndef __OCEMESSAGING__
  30. #include "OCEMessaging.h"
  31. #endif
  32.  
  33.  
  34. #ifndef __CRecordID__
  35. #include "CRecordID.h"
  36. #endif
  37.  
  38.  
  39.  
  40. //----------------------------------------
  41. //            C U n p a c k e d D S S p e c 
  42. //----------------------------------------
  43.  
  44. enum
  45. {
  46.     asString,
  47.     asLong,
  48.     asShort,
  49.     asBoolean
  50. };
  51.  
  52. //    This version uses the storage of the packed dsspec
  53. //    CDSSpec allocates new storage for the the DSSpec. Ah isn't AOCE fun.
  54.  
  55. class CUnpackedDSSpec {
  56. public:
  57.     CUnpackedDSSpec(OCEPackedRecipient* packedRecipient);
  58.     CUnpackedDSSpec() { fEntitySpecifier = &fEntity; };
  59.  
  60.     
  61.     CUnpackedDSSpec& operator =(OCEPackedRecipient* packedRecipient); 
  62.  
  63.     RecordID*        fEntitySpecifier;
  64.     OSType            fExtType;
  65.     unsigned short    fExtSize;
  66.     Ptr                fExtValue;
  67.     RecordID        fEntity;
  68.     
  69.     StringPtr        EntityName() { return (StringPtr)*(CRString*)fEntity.local.recordName; };
  70.     StringPtr        ExtValue();
  71.     StringPtr        ExtValue(short asType, Ptr buffer);
  72.  
  73.     CreationID        CID() { return fEntitySpecifier->local.cid; };
  74.     CDirectoryName&    DirName() { return ((CPackedRLI*)fEntitySpecifier->rli)->fDirectoryName; };        // sleaze.
  75.  
  76. };
  77.  
  78.  
  79.  
  80. //---------------------------------
  81. //        C D S S p e c
  82. //---------------------------------
  83.  
  84. class CDSSpec {
  85. public:
  86.                     CDSSpec(StringPtr name,StringPtr dirName,OSType extType,StringPtr extValue );
  87.                     CDSSpec(CRecordName& name,StringPtr dirName,OSType extType,StringPtr extValue );
  88.                     CDSSpec(OCEPackedRecipient* packedRecipient);
  89.                     CDSSpec(StringPtr name,CDirectoryName& dirName,OSType extType,StringPtr extValue);
  90.                     
  91.     CRecordID*        fEntitySpecifier;
  92.     OSType            fExtType;
  93.     unsigned short    fExtSize;
  94.     Ptr                fExtValue;
  95.     
  96.     CRecordID        fEntity;
  97.     CRString256        _fExtValue;
  98.     
  99.     StringPtr        EntityName() {return (StringPtr)*fEntity.fName; }
  100.     StringPtr        ExtValue(){ return (StringPtr)_fExtValue; }
  101.     
  102. };
  103.  
  104.  
  105.  
  106. #endif __CDSSpec__
  107.